Author

Tony Duan

1 R version

The version object in R holds information about the current R version you are running.

Code
version
               _                           
platform       aarch64-apple-darwin20      
arch           aarch64                     
os             darwin20                    
system         aarch64, darwin20           
status                                     
major          4                           
minor          4.3                         
year           2025                        
month          02                          
day            28                          
svn rev        87843                       
language       R                           
version.string R version 4.4.3 (2025-02-28)
nickname       Trophy Case                 

1.1 manage R version with rig

https://github.com/r-lib/rig

1.1.1 install rig

Code
brew tap r-lib/rig
brew install --cask rig

1.1.2 show current downloaded R version

Code
rig list
* name       version    aliases
------------------------------------------
  4.4-arm64  (R 4.4.3)  
* 4.5-arm64  (R 4.5.1)  

1.1.3 show current which R version can be downloaded

Code
rig available
name   version  release date  type
------------------------------------------
4.1.3  4.1.3    2022-03-10    release
4.2.3  4.2.3    2023-03-15    release
4.3.3  4.3.3    2024-02-29    release
4.4.3  4.4.3    2025-02-28    release
4.5.1  4.5.1    2025-06-13    release
next   4.5.1                  patched
devel  4.6.0                  devel

1.1.4 download R version

Code
rig add 4.4.3

1.1.5 use R 4.4.3 version

Code
#rig default 4.4-arm64

1.1.6 use R 4.5.1 version

Code
rig default 4.5-arm64

or you can choose with UI

Code
open -a Rig

2 Work with files

2.1 Get current directory

The getwd() function returns your current working directory as a string.

Code
getwd()

2.2 Get all file names under the current directory

The list.files() function returns a character vector of file and directory names in the specified directory. Without an argument, it lists files in the current directory.

Code
list.files()
 [1] "1 basic R.qmd"                 "1 basic R.rmarkdown"          
 [3] "1-basic-R.rmarkdown"           "2 probability.qmd"            
 [5] "3 Statistics.qmd"              "5 R boook.qmd"                
 [7] "6 data analytic in R book.qmd" "7 error handling.qmd"         
 [9] "hotels.csv"                    "images"                       
[11] "renv"                         

2.3 Get all file names under one level up directory

You can use .. to refer to the parent directory.

Code
list.files('../')
 [1] "_extensions"           "_freeze"               "_publish.yml"         
 [4] "_quarto.yml"           "_site"                 "data manipulation"    
 [7] "docs"                  "foldableCodeBlcok.lua" "images"               
[10] "index.qmd"             "intro"                 "Intro R.Rproj"        
[13] "LICENSE"               "other"                 "Plot"                 
[16] "Publish"               "README.md"             "Rlogo.png"            
[19] "sidebar.png"           "styles.css"           

2.4 Get file info

The file.info() function returns a data frame with information about the specified file, such as its size, creation time, and modification time.

Code
file.info("6 data analytic in R book.qmd")

2.5 Create folder

The dir.create() function creates a new directory (folder).

Code
dir.create('testing_folder')

2.6 Delete folder/file

The file.remove() function can be used to delete files. To delete an empty directory, you can also use unlink().

Code
file.remove('testing_folder')

2.7 Copy file

The file_copy() function from the fs package copies files from one location to another.

Code
library(fs)
file_copy('test.csv', 'test2.csv')

2.8 find folder name with Upper Case letter

Code
root_path <- "."            # or "c:/my_project", "~/GitHub", etc.

## ==== STEP 1 : find folders with uppercase ----------------------------
dirs <- list.dirs(root_path, recursive = FALSE, full.names = FALSE)

## Drop the root itself so we don't try to rename it
dirs <- setdiff(dirs, root_path)

## Posix-compliant: only paths whose last component has at least one A-Z
needs_rename <- dirs[grepl("[A-Z]", basename(dirs))]

if (length(needs_rename) == 0) {
  message("  no folder needs renaming")
  quit(save = "no")
}
needs_rename

2.9 Rename folder with Upper Case letter to lower case letter

Code
for (old_path in needs_rename) {
  dir_name   <- basename(old_path)
  new_name   <- tolower(dir_name)
  parent_dir <- dirname(old_path)
  new_path   <- file.path(parent_dir, new_name)

  # On case-insensitive filesystems (like macOS default), we can't
  # rename 'A' to 'a' directly if 'a' is considered the same file as 'A'.
  # We rename to a temporary name first.
  temp_path <- file.path(parent_dir, paste0("temp__", new_name))

  # 1. Rename to a temporary name that is guaranteed not to exist (or clash)
  rename_ok <- file.rename(old_path, temp_path)

  if (rename_ok) {
    # 2. Rename from temporary to the final lowercase name
    rename_ok <- file.rename(temp_path, new_path)
  }

  message(sprintf("%s -> %s  %s",
                  old_path,
                  new_path,
                  ifelse(rename_ok, "✓", "✗ failed")))
}

2.10 Download file from the internet

The download.file() function downloads a file from a given URL.

Code
url="https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-02-11/hotels.csv"

download.file(url = url, destfile = "hotels.csv")

2.11 Download table from the internet

This code scrapes a table from a Wikipedia page. It uses rvest to read the HTML content, html_table to extract tables, janitor::clean_names to clean up column names, and dplyr verbs (filter, mutate) to clean the data.

Code
library(tidyverse)
library(rvest)
library(janitor)

nba_wiki_url='https://en.wikipedia.org/wiki/List_of_NBA_champions'
  
nba_wiki_data001=nba_wiki_url %>% read_html() %>% html_table()

nba_wiki_data002=nba_wiki_data001[[2]] %>% clean_names()

nba_wiki_data003=nba_wiki_data002 %>%filter(!row_number() %in% c(1, 5)) %>% mutate(year=str_sub(year, 1, 4))

tail(nba_wiki_data003)

3 Handle errors

tryCatch allows you to handle errors gracefully. The code in the first block is executed. If an error occurs, the error function is called.

Code
tryCatch({
  1+who # This will cause an error because 'who' is not defined
},error=function(e){
  message(paste0('Here is some error:',e))
})

print('end of the code chunk')

4 Condition with if/elif/else

This is a standard conditional statement. It checks a condition and executes different code blocks based on whether the condition is true or false.

Code
x <- -5
if(x > 10){
print("Non-negative number and better than 10")
} else if (x > 0) {
  print("Non-negative number and better than 0")
} else {
print("Negative number")
}
[1] "Negative number"

5 Loops

5.1 for Loop

A for loop iterates over a sequence of values.

Code
for (x in 1:4) {
  print(x)
}
[1] 1
[1] 2
[1] 3
[1] 4

break exits the loop prematurely.

Code
for (x in 1:6) {
  if (x == 4) {break}
  print(x)
}
[1] 1
[1] 2
[1] 3

next skips the current iteration and proceeds to the next one.

Code
for (x in 1:6) {
  if (x == 4) {next}
  print(x)
}
[1] 1
[1] 2
[1] 3
[1] 5
[1] 6

5.2 Using map() function for loops

The map functions from the purrr package (part of tidyverse) provide a more functional approach to iteration. map returns a list, map_dbl returns a numeric vector, and map_chr returns a character vector.

Code
library(tidyverse)
Code
map(
  1:3, 
    \(x) x+2
  )
[[1]]
[1] 3

[[2]]
[1] 4

[[3]]
[1] 5
Code
map_dbl(
  1:3, 
    \(x) x+2
  )
[1] 3 4 5
Code
map_chr(
  1:3, 
    \(x) x+2
  )
[1] "3.000000" "4.000000" "5.000000"

5.3 Error handling in a for loop: printing out errors

You can use tryCatch inside a loop to handle errors on a per-iteration basis.

Code
stuff <- list(12, 9, 2, "cat", 25, 10, "bird")

loop_num=0
for (i in 1:6) {
  loop_num=loop_num+1
  tryCatch (print(1+i),
           error = function(e){
           message(paste("An error occurred for loop num", loop_num,":\n"), e)
         })
}
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7

5.4 while Loop

A while loop continues as long as a condition is true.

Code
i <- 1
while (i < 6) {
  print(i)
  i <- i + 1
}
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5

5.5 Error handling in a while loop: retrying until the error is gone

This example shows a while loop that attempts to run code that causes an error. The tryCatch block catches the error and modifies a variable, allowing the loop to eventually terminate.

Code
i=0
a=0
while (i < 4) {
  a=a+1
  print(i)
  tryCatch({
  asdfgaergae5gh5hae5h # This will cause an error
    i=i+1
  },error = function(msg){print('eeeeeeee')
    i=i-1
    print(paste0("new i : ",i))
   
    })
   if(a>10){break} # Safety break to prevent an infinite loop
  }
[1] 0
[1] "eeeeeeee"
[1] "new i : -1"
[1] 0
[1] "eeeeeeee"
[1] "new i : -1"
[1] 0
[1] "eeeeeeee"
[1] "new i : -1"
[1] 0
[1] "eeeeeeee"
[1] "new i : -1"
[1] 0
[1] "eeeeeeee"
[1] "new i : -1"
[1] 0
[1] "eeeeeeee"
[1] "new i : -1"
[1] 0
[1] "eeeeeeee"
[1] "new i : -1"
[1] 0
[1] "eeeeeeee"
[1] "new i : -1"
[1] 0
[1] "eeeeeeee"
[1] "new i : -1"
[1] 0
[1] "eeeeeeee"
[1] "new i : -1"
[1] 0
[1] "eeeeeeee"
[1] "new i : -1"

6 Functions

6.1 Without Arguments

This defines and calls a simple function that takes no arguments.

Code
my_function <- function() { 
  print("Hello World!")
}

my_function()
[1] "Hello World!"

6.2 With Arguments

This function takes one argument, x, and returns its value plus 10.

Code
adding_ten <- function(x) { 
  a=x+10
  return(a)
}

adding_ten(5)
[1] 15

6.3 With default Arguments

This function has a default value for x. If the function is called without an argument for x, the default value of 10 is used.

Code
adding_ten <- function(x=10) { 
  a=x+10
  return(a)
}

adding_ten()
[1] 20

6.4 Check function Arguments

The args() function displays the arguments of a function.

Code
args(adding_ten)
function (x = 10) 
NULL

6.5 Warning in function

The warning() function issues a warning message without stopping the execution of the function.

Code
adding_ten <- function(x=10) { 
  a=x+10
  if(a>50){
    warning('its better than 50')
  }
  return(a)
}

adding_ten(100)
[1] 110

6.6 Stop in function

The stop() function halts the execution of the function and prints an error message.

Code
adding_ten <- function(x=10) { 
  a=x+10
  if(a>50){
    stop('its better than 50')
  }
  return(a)
}

6.7 Use try to bypass errors

The try() function is a simplified version of tryCatch. It runs an expression and if an error occurs, it returns an object of class try-error but allows the script to continue.

Code
try(adding_ten(100))
[1] 110
Code
5+10
[1] 15

7 Program running time

This code measures the time it takes to run a piece of code by recording the start and end times.

Code
start_time=Sys.time()

v=matrix(1:100000000)
c=v*v

end_time=Sys.time()

end_time-start_time
Time difference of 0.63539 secs

8 Packages

8.1 Install R package

8.1.1 Install from CRAN

install.packages() is the standard way to install packages from CRAN.

Code
install.packages('dplyr',repos = "http://cran.us.r-project.org")

8.1.2 Install old version from CRAN

The remotes package allows you to install specific versions of packages.

Code
require(remotes)
install_version("plotly", version = "4.10.2")

8.1.3 Install from Github

The pak package can install packages directly from GitHub repositories.

Code
pak::pkg_install("tidymodels/learntidymodels")

8.2 Check one package version

packageVersion() returns the version of the specified package.

Code
packageVersion("tidyverse")
[1] '2.0.0'

8.3 Check package location

pak::pkg_status() provides detailed information about a package, including its installation path.

Code
pak::pkg_status("ggplot2") |> t()
                  123                                                                                                               
library           "/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library"                                            
package           "ggplot2"                                                                                                         
version           "3.5.1"                                                                                                           
title             "Create Elegant Data Visualisations Using the Grammar of Graphics"                                                
depends           "R (>= 3.5)"                                                                                                      
imports           "cli, glue, grDevices, grid, gtable (>= 0.1.1), isoband,\n        lifecycle (> 1.0.1), MASS, mgcv, rl" [truncated]
license           "MIT + file LICENSE"                                                                                              
needscompilation  FALSE                                                                                                             
repository        "CRAN"                                                                                                            
built             "R 4.4.0; ; 2024-04-23 11:40:42 UTC; unix"                                                                        
suggests          "covr, dplyr, ggplot2movies, hexbin, Hmisc, knitr, mapproj,\n        maps, multcomp, munsell, nlme, p" [truncated]
linkingto         "NA"                                                                                                              
remotetype        "NA"                                                                                                              
remotepkgref      "NA"                                                                                                              
remoteref         "NA"                                                                                                              
remoterepos       "NA"                                                                                                              
remotepkgplatform "NA"                                                                                                              
remotesha         "NA"                                                                                                              
priority          "NA"                                                                                                              
enhances          "sp"                                                                                                              
remotehost        "NA"                                                                                                              
remoterepo        "NA"                                                                                                              
remoteusername    "NA"                                                                                                              
remotes           "NA"                                                                                                              
md5sum            "NA"                                                                                                              
platform          "*"                                                                                                               
biocviews         "NA"                                                                                                              
sysreqs           "NA"                                                                                                              
ref               "installed::/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/ggplot2"                         
type              "installed"                                                                                                       
status            "OK"                                                                                                              
rversion          "R 4.4.0"                                                                                                         
sources           character,0                                                                                                       
repotype          "cran"                                                                                                            
deps              tbl,5                                                                                                             

8.4 Check package dependencies

pak::pkg_deps_tree() shows a tree of the dependencies for a given package.

Code
pak::pkg_deps_tree("tibble")
tibble 3.3.0 ✨🔧 ⬇ (690.09 kB)
├─cli 3.6.5 ✨🔧 ⬇ (1.46 MB)
├─lifecycle 1.0.4 ✨ ⬇ (124.78 kB)
│ ├─cli
│ ├─glue 1.8.0 ✨🔧 ⬇ (173.70 kB)
│ └─rlang 1.1.6 ✨🔧 ⬇ (1.89 MB)
├─magrittr 2.0.3 ✨🔧 ⬇ (233.52 kB)
├─pillar 1.11.0 ✨ ⬇ (659.43 kB)
│ ├─cli
│ ├─glue
│ ├─lifecycle
│ ├─rlang
│ ├─utf8 1.2.6 ✨🔧 ⬇ (209.16 kB)
│ └─vctrs 0.6.5 ✨🔧 ⬇ (1.89 MB)
│   ├─cli
│   ├─glue
│   ├─lifecycle
│   └─rlang
├─pkgconfig 2.0.3 ✨ ⬇ (18.45 kB)
├─rlang
└─vctrs

Key:  ✨ new |  ⬇ download | 🔧 compile

8.5 Check all installed packages

installed.packages() returns a matrix of all installed packages. This code filters it and displays it in an interactive table using gt.

Code
library(gt)
ip = as.data.frame(installed.packages()[,c(1,3:4)])
ip = ip[is.na(ip$Priority),1:2,drop=FALSE]
ip |> gt() |> opt_interactive()

8.6 Check currently loaded packages

.packages() returns a character vector of the packages that are currently loaded in your R session.

Code
library(dplyr)
installed_package = as.data.frame(installed.packages()[,c(1,3:4)])
installed_package = installed_package[is.na(installed_package$Priority),1:2,drop=FALSE]
installed_package |> filter(Package %in% (.packages()))|> gt() |> opt_interactive()

8.7 List all packages on CRAN

available.packages() returns a matrix of all packages available on CRAN.

Code
cran_package_num=available.packages(repos = "http://cran.us.r-project.org") |> as.data.frame()

8.8 Check local installed old packages compared with CRAN

old.packages() checks for installed packages that have newer versions available on CRAN.

Code
old.packages(repos = "http://cran.us.r-project.org") |> as.data.frame() |> gt::gt() 
Package LibPath Installed Built ReposVer Repository
annotater /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.2.3 4.4.0 0.2.4 http://cran.us.r-project.org/src/contrib
anytime /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.3.11 4.4.1 0.3.12 http://cran.us.r-project.org/src/contrib
arrow /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 19.0.1 4.4.1 20.0.0.2 http://cran.us.r-project.org/src/contrib
AsioHeaders /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.22.1-2 4.4.1 1.30.2-1 http://cran.us.r-project.org/src/contrib
bigD /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.3.0 4.4.1 0.3.1 http://cran.us.r-project.org/src/contrib
blastula /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.3.5 4.4.0 0.3.6 http://cran.us.r-project.org/src/contrib
bookdown /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.42 4.4.1 0.43 http://cran.us.r-project.org/src/contrib
broom /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.0.7 4.4.1 1.0.8 http://cran.us.r-project.org/src/contrib
cards /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.5.1 4.4.1 0.6.1 http://cran.us.r-project.org/src/contrib
chromote /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.5.0 4.4.1 0.5.1 http://cran.us.r-project.org/src/contrib
cli /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 3.6.4 4.4.1 3.6.5 http://cran.us.r-project.org/src/contrib
cluster /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 2.1.8 4.4.3 2.1.8.1 http://cran.us.r-project.org/src/contrib
collections /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.3.7 4.4.1 0.3.8 http://cran.us.r-project.org/src/contrib
commonmark /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.9.2 4.4.1 2.0.0 http://cran.us.r-project.org/src/contrib
cowplot /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.1.3 4.4.0 1.2.0 http://cran.us.r-project.org/src/contrib
curl /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 6.2.2 4.4.1 6.4.0 http://cran.us.r-project.org/src/contrib
data.table /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.17.0 4.4.1 1.17.8 http://cran.us.r-project.org/src/contrib
Deriv /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 4.1.6 4.4.1 4.2.0 http://cran.us.r-project.org/src/contrib
diffobj /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.3.5 4.4.0 0.3.6 http://cran.us.r-project.org/src/contrib
doBy /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 4.6.25 4.4.1 4.7.0 http://cran.us.r-project.org/src/contrib
dtt /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.1-2 4.4.0 0.1-2.1 http://cran.us.r-project.org/src/contrib
duckdb /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.2.0 4.4.1 1.3.2 http://cran.us.r-project.org/src/contrib
ellmer /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.2.0 4.4.1 0.2.1 http://cran.us.r-project.org/src/contrib
evaluate /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.0.3 4.4.1 1.0.4 http://cran.us.r-project.org/src/contrib
foreign /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.8-88 4.4.3 0.8-90 http://cran.us.r-project.org/src/contrib
fs /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.6.5 4.4.1 1.6.6 http://cran.us.r-project.org/src/contrib
future /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.34.0 4.4.0 1.58.0 http://cran.us.r-project.org/src/contrib
gapminder /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.0.0 4.4.0 1.0.1 http://cran.us.r-project.org/src/contrib
gdtools /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.4.1 4.4.1 0.4.2 http://cran.us.r-project.org/src/contrib
gemini.R /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.8.0 4.4.1 0.15.0 http://cran.us.r-project.org/src/contrib
generics /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.1.3 4.4.0 0.1.4 http://cran.us.r-project.org/src/contrib
gert /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 2.1.4 4.4.1 2.1.5 http://cran.us.r-project.org/src/contrib
gganimate /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.0.9 4.4.0 1.0.10 http://cran.us.r-project.org/src/contrib
ggfun /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.1.8 4.4.1 0.2.0 http://cran.us.r-project.org/src/contrib
ggmap /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 4.0.0 4.4.0 4.0.1 http://cran.us.r-project.org/src/contrib
ggplot2 /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 3.5.1 4.4.0 3.5.2 http://cran.us.r-project.org/src/contrib
ggpubr /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.6.0 4.4.0 0.6.1 http://cran.us.r-project.org/src/contrib
gh /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.4.1 4.4.0 1.5.0 http://cran.us.r-project.org/src/contrib
globals /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.16.3 4.4.0 0.18.0 http://cran.us.r-project.org/src/contrib
gtExtras /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.5.0 4.4.0 0.6.0 http://cran.us.r-project.org/src/contrib
gtsummary /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 2.1.0 4.4.1 2.3.0 http://cran.us.r-project.org/src/contrib
haven /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 2.5.4 4.4.0 2.5.5 http://cran.us.r-project.org/src/contrib
httpuv /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.6.15 4.4.0 1.6.16 http://cran.us.r-project.org/src/contrib
httr2 /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.1.1 4.4.1 1.2.0 http://cran.us.r-project.org/src/contrib
jpeg /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.1-10 4.4.0 0.1-11 http://cran.us.r-project.org/src/contrib
keyring /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.3.2 4.4.0 1.4.1 http://cran.us.r-project.org/src/contrib
knitr /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.49 4.4.1 1.50 http://cran.us.r-project.org/src/contrib
lares /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 5.2.13 4.4.1 5.3.1 http://cran.us.r-project.org/src/contrib
later /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.4.1 4.4.1 1.4.2 http://cran.us.r-project.org/src/contrib
lattice /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.22-6 4.4.3 0.22-7 http://cran.us.r-project.org/src/contrib
leafem /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.2.3 4.4.0 0.2.4 http://cran.us.r-project.org/src/contrib
legendry /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.2.1 4.4.1 0.2.2 http://cran.us.r-project.org/src/contrib
lme4 /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.1-36 4.4.1 1.1-37 http://cran.us.r-project.org/src/contrib
magick /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 2.8.5 4.4.1 2.8.7 http://cran.us.r-project.org/src/contrib
maps /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 3.4.2.1 4.4.1 3.4.3 http://cran.us.r-project.org/src/contrib
markdown /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.13 4.4.0 2.0 http://cran.us.r-project.org/src/contrib
MASS /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 7.3-64 4.4.3 7.3-65 http://cran.us.r-project.org/src/contrib
Matrix /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.7-2 4.4.3 1.7-3 http://cran.us.r-project.org/src/contrib
MatrixModels /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.5-3 4.4.0 0.5-4 http://cran.us.r-project.org/src/contrib
mgcv /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.9-1 4.4.3 1.9-3 http://cran.us.r-project.org/src/contrib
miniUI /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.1.1.1 4.4.0 0.1.2 http://cran.us.r-project.org/src/contrib
nlme /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 3.1-167 4.4.3 3.1-168 http://cran.us.r-project.org/src/contrib
nloptr /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 2.1.1 4.4.0 2.2.1 http://cran.us.r-project.org/src/contrib
officer /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.6.8 4.4.1 0.6.10 http://cran.us.r-project.org/src/contrib
openssl /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 2.3.2 4.4.1 2.3.3 http://cran.us.r-project.org/src/contrib
packrat /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.9.2 4.4.1 0.9.3 http://cran.us.r-project.org/src/contrib
pak /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.8.0.1 4.4.1 0.9.0 http://cran.us.r-project.org/src/contrib
parallelly /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.42.0 4.4.1 1.45.0 http://cran.us.r-project.org/src/contrib
patchwork /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.3.0 4.4.1 1.3.1 http://cran.us.r-project.org/src/contrib
pbkrtest /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.5.3 4.4.0 0.5.5 http://cran.us.r-project.org/src/contrib
pillar /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.10.1 4.4.1 1.11.0 http://cran.us.r-project.org/src/contrib
pins /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.4.0 4.4.1 1.4.1 http://cran.us.r-project.org/src/contrib
pkgbuild /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.4.6 4.4.1 1.4.8 http://cran.us.r-project.org/src/contrib
pkgcache /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 2.2.3 4.4.1 2.2.4 http://cran.us.r-project.org/src/contrib
pkgdepends /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.8.0 4.4.1 0.9.0 http://cran.us.r-project.org/src/contrib
pkgdown /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 2.1.1 4.4.1 2.1.3 http://cran.us.r-project.org/src/contrib
plotly /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 4.10.4 4.4.0 4.11.0 http://cran.us.r-project.org/src/contrib
polyglotr /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.5.2 4.4.1 1.6.1 http://cran.us.r-project.org/src/contrib
promises /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.3.2 4.4.1 1.3.3 http://cran.us.r-project.org/src/contrib
ps /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.9.0 4.4.1 1.9.1 http://cran.us.r-project.org/src/contrib
purrr /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.0.4 4.4.1 1.1.0 http://cran.us.r-project.org/src/contrib
qpdf /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.3.4 4.4.1 1.4.1 http://cran.us.r-project.org/src/contrib
quantmod /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.4.26 4.4.0 0.4.28 http://cran.us.r-project.org/src/contrib
quantreg /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 6.00 4.4.1 6.1 http://cran.us.r-project.org/src/contrib
R.cache /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.16.0 4.4.0 0.17.0 http://cran.us.r-project.org/src/contrib
R.oo /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.27.0 4.4.1 1.27.1 http://cran.us.r-project.org/src/contrib
ragg /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.3.3 4.4.1 1.4.0 http://cran.us.r-project.org/src/contrib
raster /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 3.6-31 4.4.1 3.6-32 http://cran.us.r-project.org/src/contrib
Rcpp /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.0.14 4.4.1 1.1.0 http://cran.us.r-project.org/src/contrib
RcppTOML /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.2.2 4.4.0 0.2.3 http://cran.us.r-project.org/src/contrib
RCurl /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.98-1.16 4.4.0 1.98-1.17 http://cran.us.r-project.org/src/contrib
Rdpack /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 2.6.2 4.4.1 2.6.4 http://cran.us.r-project.org/src/contrib
readxl /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.4.4 4.4.1 1.4.5 http://cran.us.r-project.org/src/contrib
reformulas /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.4.0 4.4.1 0.4.1 http://cran.us.r-project.org/src/contrib
renv /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.1.2 4.4.1 1.1.4 http://cran.us.r-project.org/src/contrib
reticulate /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.42.0 4.4.1 1.43.0 http://cran.us.r-project.org/src/contrib
rlang /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.1.5 4.4.1 1.1.6 http://cran.us.r-project.org/src/contrib
rprojroot /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 2.0.4 4.4.0 2.1.0 http://cran.us.r-project.org/src/contrib
rsconnect /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.3.4 4.4.1 1.5.0 http://cran.us.r-project.org/src/contrib
RSQLite /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 2.3.9 4.4.1 2.4.2 http://cran.us.r-project.org/src/contrib
s2 /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.1.7 4.4.0 1.1.9 http://cran.us.r-project.org/src/contrib
sass /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.4.9 4.4.0 0.4.10 http://cran.us.r-project.org/src/contrib
scales /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.3.0 4.4.0 1.4.0 http://cran.us.r-project.org/src/contrib
sf /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.0-19 4.4.1 1.0-21 http://cran.us.r-project.org/src/contrib
shiny /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.10.0 4.4.1 1.11.1 http://cran.us.r-project.org/src/contrib
shinydashboard /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.7.2 4.4.0 0.7.3 http://cran.us.r-project.org/src/contrib
stringi /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.8.4 4.4.0 1.8.7 http://cran.us.r-project.org/src/contrib
summarytools /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.1.1 4.4.1 1.1.4 http://cran.us.r-project.org/src/contrib
svglite /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 2.1.3 4.4.0 2.2.1 http://cran.us.r-project.org/src/contrib
systemfonts /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.2.1 4.4.1 1.2.3 http://cran.us.r-project.org/src/contrib
terra /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.8-29 4.4.1 1.8-60 http://cran.us.r-project.org/src/contrib
tesseract /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 5.2.2 4.4.1 5.2.3 http://cran.us.r-project.org/src/contrib
textshaping /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.0.0 4.4.1 1.0.1 http://cran.us.r-project.org/src/contrib
textutils /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.4-1 4.4.0 0.4-2 http://cran.us.r-project.org/src/contrib
tibble /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 3.2.1 4.4.0 3.3.0 http://cran.us.r-project.org/src/contrib
tidyfinance /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.4.3 4.4.1 0.4.4 http://cran.us.r-project.org/src/contrib
tidygeocoder /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.0.5 4.4.0 1.0.6 http://cran.us.r-project.org/src/contrib
tidytuesdayR /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.1.2 4.4.1 1.2.1 http://cran.us.r-project.org/src/contrib
tinytex /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.56 4.4.1 0.57 http://cran.us.r-project.org/src/contrib
tzdb /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.4.0 4.4.0 0.5.0 http://cran.us.r-project.org/src/contrib
units /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.8-5 4.4.0 0.8-7 http://cran.us.r-project.org/src/contrib
urltools /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.7.3 4.4.0 1.7.3.1 http://cran.us.r-project.org/src/contrib
utf8 /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.2.4 4.4.0 1.2.6 http://cran.us.r-project.org/src/contrib
V8 /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 6.0.1 4.4.1 6.0.4 http://cran.us.r-project.org/src/contrib
vosonSML /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.32.7 4.4.0 0.35.1 http://cran.us.r-project.org/src/contrib
waldo /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.6.1 4.4.1 0.6.2 http://cran.us.r-project.org/src/contrib
webshot2 /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.1.1 4.4.0 0.1.2 http://cran.us.r-project.org/src/contrib
websocket /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.4.2 4.4.1 1.4.4 http://cran.us.r-project.org/src/contrib
writexl /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.5.1 4.4.1 1.5.4 http://cran.us.r-project.org/src/contrib
xfun /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.51 4.4.1 0.52 http://cran.us.r-project.org/src/contrib
yyjsonr /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.1.20 4.4.0 0.1.21 http://cran.us.r-project.org/src/contrib
zeallot /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 0.1.0 4.4.1 0.2.0 http://cran.us.r-project.org/src/contrib
zip /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 2.3.2 4.4.1 2.3.3 http://cran.us.r-project.org/src/contrib
zoo /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library 1.8-13 4.4.1 1.8-14 http://cran.us.r-project.org/src/contrib

8.9 Update all installed packages

update.packages() updates all installed packages to their latest versions.

Code
update.packages(ask = FALSE, checkBuilt = TRUE)

8.10 Check package install location

.libPaths() shows the library paths where R packages are installed.

Code
.libPaths()
[1] "/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library"

9 Version control

The renv package helps manage project-specific package libraries, making your projects more reproducible.

9.1 Initialize renv and create renv.lock with currently loaded packages

renv::init() initializes renv in a project, creating a private library and a renv.lock file that records the package versions used.

Code
renv::init()

9.2 Update lock file

renv::snapshot() updates the renv.lock file to reflect the current state of the project’s library.

Code
renv::snapshot()

9.3 Make all current package versions back to the renv list

renv::restore() restores the project library to the state recorded in renv.lock.

Code
renv::restore()

10 Stop when code runs too long

The withTimeout() function from the R.utils package runs an expression and stops it if it exceeds the specified timeout.

Code
library(R.utils)
foo <- function() {
  print("Tic")
  for (kk in 1:100) {
    print(kk)
    Sys.sleep(0.1)
  }
  print("Tac")
}

withTimeout({
  foo()
}, timeout = 1.5, onTimeout = "warning")

11 Check website connection

The system() function can run shell commands. Here, it uses ping to check if a website is reachable.

Code
url='www.bing.com'
connect_result=system(paste0('ping -c 1 ',url))
connect_result

12 check internet speed and connection

Code
library(httr)
library(jsonlite)

get_location <- function() {
  response <- GET("http://ip-api.com/json/")

  # Check if the request was successful (status code 200)
  if (status_code(response) == 200) {
    # Parse the JSON content from the response
    data <- fromJSON(content(response, "text", encoding = "UTF-8"))

    # Print the extracted information
    cat(paste0("IP Address: ", data$query, "\n"))
    cat(paste0("City: ", data$city, "\n"))
    cat(paste0("Region: ", data$regionName, "\n"))
    cat(paste0("Country: ", data$country, "\n"))
    cat(paste0("ISP: ", data$isp, "\n"))
    cat(paste0("Latitude: ", data$lat, ", Longitude: ", data$lon, "\n"))
  } else {
    cat("Failed to get location\n")
  }
}

# Call the function
get_location()

13 check internet speed and connection

Code
test_connection <- function(host, port = 80, timeout = 3) {
  con <- NULL
  reachable <- FALSE
  tryCatch({
    # Open a socket connection in read/write mode with timeout
    con <- socketConnection(host = host, port = port, open = "r+", blocking = TRUE, timeout = timeout)
    reachable <- TRUE
  }, error = function(e) {
    reachable <- FALSE
  }, finally = {
    if (!is.null(con)) close(con)
  })
  return(reachable)
}

check_sites <- function() {
  sites <- c("www.baidu.com", "www.google.com")
  cat("\n🌍 Site Connectivity:\n")
  for (site in sites) {
    reachable <- test_connection(site)
    status <- ifelse(reachable, "✅ Reachable", "❌ Unreachable")
    cat(sprintf("  %-20s %s\n", site, status))
  }
}

check_sites()
Code
library(httr)
library(curl) # Used for download progress if needed, httr leverages it
library(jsonlite) # Not strictly needed for this code, but useful for general web tasks

# Suppress SSL/TLS verification warnings for self-signed certificates or similar
# Use with caution in production. This is analogous to urllib3.disable_warnings
options(httr_oauth_cache = FALSE) # Prevent caching of auth tokens if any
# For specific SSL verification issues, you might need to set config(ssl_verifypeer = 0L)
# or config(ssl_verifyhost = 0L) in httr GET/POST calls, but it's generally not recommended.

# Function to test download speed
test_download_speed <- function(url, test_size_bytes = 1048576) { # 1MB
  start_time <- Sys.time()

  # Initiate the GET request with stream=TRUE (equivalent to httr's default streaming)
  # For large files, curl::curl_download is often more efficient for raw bytes
  # However, for a test_size_bytes limit, we can manage with httr's GET and content()
  response <- GET(url)

  # Check if the request was successful
  if (status_code(response) != 200) {
    warning("Download request failed with status code: ", status_code(response))
    return(NA) # Return NA if download failed
  }

  # Get content as raw bytes
  downloaded_content <- content(response, "raw")
  bytes_downloaded <- length(downloaded_content)

  # Only consider bytes up to test_size_bytes
  if (bytes_downloaded > test_size_bytes) {
    bytes_downloaded <- test_size_bytes
  }

  end_time <- Sys.time()
  duration <- as.numeric(difftime(end_time, start_time, units = "secs"))

  if (duration == 0) {
    return(Inf) # Avoid division by zero if duration is extremely small
  }

  # Calculate Mbps: (bytes * 8 bits/byte) / (duration in seconds * 1,000,000 bits/Mb)
  mbps <- (bytes_downloaded * 8) / (duration * 1e6)
  return(mbps)
}
Code
# Function to test upload speed
test_upload_speed <- function(url, test_size_bytes = 1048576) { # 1MB
  # Create raw data for upload
  # In R, raw vectors are used for binary data.
  # This creates a raw vector of 'test_size_bytes' length filled with 0x78 (ASCII 'x')
  data_to_upload <- as.raw(rep(charToRaw("x"), test_size_bytes))

  start_time <- Sys.time()

  # Perform the POST request. The 'body' argument takes raw data.
  response <- POST(url, body = data_to_upload, encode = "raw") # encode="raw" sends as-is

  end_time <- Sys.time()
  duration <- as.numeric(difftime(end_time, start_time, units = "secs"))

  if (duration == 0) {
    return(Inf) # Avoid division by zero if duration is extremely small
  }

  # Check if the upload was successful
  if (status_code(response) != 200) {
    warning("Upload request failed with status code: ", status_code(response))
    # Optionally print response content for debugging
    # print(content(response, "text", encoding = "UTF-8"))
    return(NA) # Return NA if upload failed
  }

  # Calculate Mbps: (bytes * 8 bits/byte) / (duration in seconds * 1,000,000 bits/Mb)
  mbps <- (test_size_bytes * 8) / (duration * 1e6)
  return(mbps)
}
Code
# Define URLs (these are examples and might not be optimal for China mainland)
download_url <- "http://speedtest.tele2.net/10MB.zip"
upload_url <- "http://speedtest.cc.cloudxns.net/speedtest/upload.php"
Code
# Test download speed
message("Testing download speed...") # Use message for user-friendly output
down_speed <- test_download_speed(download_url)
if (!is.na(down_speed)) {
  cat(sprintf("Download speed: %.2f Mbps\n", down_speed))
} else {
  cat("Download speed test failed.\n")
}
Code
# Test upload speed
message("Testing upload speed...")
up_speed <- test_upload_speed(upload_url)
if (!is.na(up_speed)) {
  cat(sprintf("Upload speed: %.2f Mbps\n", up_speed))
} else {
  cat("Upload speed test failed.\n")
}

14 Using Python

The reticulate package allows you to call Python from within R.

14.1 Select Python version

reticulate::py_available() checks if Python is available, and reticulate::py_config() shows the Python configuration that reticulate is using.

Code
reticulate::py_available()
[1] FALSE
Code
reticulate::py_config()
python:         /Users/jinchaoduan/.cache/uv/archive-v0/UrOpP-HJIh2TRyEyDTspO/bin/python3
libpython:      /Users/jinchaoduan/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/libpython3.11.dylib
pythonhome:     /Users/jinchaoduan/.cache/uv/archive-v0/UrOpP-HJIh2TRyEyDTspO:/Users/jinchaoduan/.cache/uv/archive-v0/UrOpP-HJIh2TRyEyDTspO
virtualenv:     /Users/jinchaoduan/.cache/uv/archive-v0/UrOpP-HJIh2TRyEyDTspO/bin/activate_this.py
version:        3.11.11 (main, Mar 11 2025, 17:41:13) [Clang 20.1.0 ]
numpy:          /Users/jinchaoduan/.cache/uv/archive-v0/UrOpP-HJIh2TRyEyDTspO/lib/python3.11/site-packages/numpy
numpy_version:  2.3.1

NOTE: Python version was forced by py_require()

14.2 Run Python in R

source_python() executes a Python script and makes its objects available in the R environment.

Code
source_python("flights.py")
Code
sessionInfo()
sessionInfo()
R version 4.4.3 (2025-02-28)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.5

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Asia/Shanghai
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] gt_1.0.0        lubridate_1.9.4 forcats_1.0.0   stringr_1.5.1  
 [5] dplyr_1.1.4     purrr_1.0.4     readr_2.1.5     tidyr_1.3.1    
 [9] tibble_3.2.1    ggplot2_3.5.1   tidyverse_2.0.0

loaded via a namespace (and not attached):
 [1] sass_0.4.9        utf8_1.2.4        generics_0.1.3    xml2_1.3.8       
 [5] lattice_0.22-6    stringi_1.8.4     hms_1.1.3         digest_0.6.37    
 [9] magrittr_2.0.3    evaluate_1.0.3    grid_4.4.3        timechange_0.3.0 
[13] fastmap_1.2.0     rprojroot_2.0.4   Matrix_1.7-2      jsonlite_2.0.0   
[17] processx_3.8.6    ps_1.9.0          crosstalk_1.2.1   scales_1.3.0     
[21] cli_3.6.4         rlang_1.1.5       pak_0.8.0.1       munsell_0.5.1    
[25] withr_3.0.2       reactR_0.6.1      yaml_2.3.10       tools_4.4.3      
[29] tzdb_0.4.0        colorspace_2.1-1  here_1.0.1        reticulate_1.42.0
[33] png_0.1-8         vctrs_0.6.5       R6_2.6.1          lifecycle_1.0.4  
[37] reactable_0.4.4   htmlwidgets_1.6.4 pkgconfig_2.0.3   callr_3.7.6      
[41] pillar_1.10.1     gtable_0.3.6      Rcpp_1.0.14       glue_1.8.0       
[45] xfun_0.51         tidyselect_1.2.1  rstudioapi_0.17.1 knitr_1.49       
[49] htmltools_0.5.8.1 rmarkdown_2.29    compiler_4.4.3   
Back to top